<%@ page language="java" import="util.*,bean.*,databaseDAO.*,java.util.*" pageEncoding="UTF-8" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Utf-8">
<title>添加一个新用户</title>
<link rel="stylesheet" href="../welcome/style.css">
<script type="text/javascript" src="js/jquery.js"></script>
</script>
</head>
<body>
	<form accept-charset="utf-8" name="form" method="post" action="../LoginServlet?a=adduser">
	<%
   UserBean ub = (UserBean)session.getAttribute("user");
	RoleManagement rm = new RoleManagement();
	
	List<RoleBean> list = rm.queryRoles();
	Iterator<RoleBean>it = list.iterator();
	RoleBean rb = null;
	
%>

		<div>
		<h3 class="h3">添加用户</h3>
		   <p> <input type="text" placeholder="昵称" name="nickName" /></p>
			<p> <input type="text" placeholder="用户名" name="userName" /></p>
		    <p> <input type="password" placeholder="用户密码" name="password" /></p>
			<p> <input type="text" placeholder="用户描述" name="userDescription" /></p>
			<p align="center"> 
				<select  name="userRole" id="userRole" >
				<% 
				//if(it.hasNext()){
				//	rb = it.next();
				%>
				<%-- <OPTION  selected='selected'><%=rb.getRoleName() %></OPTION> --%>
				<%//} %>
				<%while(it.hasNext()){
					rb = it.next(); %>
				<OPTION  selected='selected' value='<%=rb.getRoleID()%>'><%=rb.getRoleName() %></OPTION>
				<%} %>
				</select>
			<!-- <input type="text" placeholder="用户角色" name="userRole" /> -->
			</p>
			 <input type="submit" placeholder="提交" name="submit" />&nbsp;
			 <input type="reset" placeholder="重置" name="reset" />
			
			
		</div>
	</form>
</body>
</html>